using UnityEngine;

namespace HybridCLR.Extension.Editor
{
    [UnityEngine.CreateAssetMenu(menuName = "HybridCLR Extension/Config")]
    public class BuildConfig : UnityEngine.ScriptableObject
    {
        public BuildParam buildParam;
    }
    
    [UnityEditor.CustomEditor(typeof(BuildConfig))]
    public class BuildConfigEditor : UnityEditor.Editor
    {
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            GUILayout.Space(10);
            BuildParam  buildParam = ((BuildConfig)target).buildParam;
            if (Button("BuildDllAndMove",GUILayout.Height(30)))
            {
                Commond.BuildDllBuildMove(buildParam);
            }
            if (Button($"Build ({buildParam.CatalogUpdateType})",GUILayout.Height(30)))
            {
                Commond.Build(buildParam);
            }
        }

        private bool Button(string text, params GUILayoutOption[] options)
        {
            GUILayout.Space(10);
            return GUILayout.Button(text, options);
        }
    }
}